package com.lixy.demo.springcloud.ch4_5.controller;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.lixy.demo.springcloud.ch4_5.entity.User;
import com.lixy.demo.springcloud.ch4_5.repo.UserRepository;

@RestController
public class UserController {

	@GetMapping("/{id}")
	public User findById( @PathVariable Long id ) {
		User findOne = this.repo.findOne( id );
		return findOne;
	}
	
	@Autowired
	private UserRepository repo;
}
